package com.googlecode.lightest.studio

class Annotation {
    String name
    String member
    
    static hasMany = [ values: String ]
    
    static constraints = {
        name (blank: false)
        member (nullable: true)
    }

    String toString() {
        return name + (member ? ".${member}" : "")
    }

    @Override
    boolean equals(Object obj) {
        return (
            obj instanceof Annotation &&
            obj.name == name &&
            obj.member == member
        )
    }

    @Override
    int hashCode() {
        return name.hashCode() + (member?.hashCode() ?: 0)
    }
}
